#include "seckeyinfo.h"
#include <string.h>
#include <QDebug>

SeckeyInfo::SeckeyInfo() :
    status(false),
    seckeyID(0)
{
    memset(seckey, 0, sizeof(seckey));
    memset(clientID, 0, sizeof(clientID));
    memset(serverID, 0, sizeof(serverID));
}

SeckeyInfo::SeckeyInfo(bool status, int keyid, QString clientid, QString serverid, QString key) :
    status(status),
    seckeyID(keyid)
{
    strcpy(seckey, key.toUtf8().data());
    strcpy(clientID, clientid.toUtf8().data());
    strcpy(serverID, serverid.toUtf8().data());
}

bool SeckeyInfo::operator==(SeckeyInfo &info)
{
    if(status == info.status &&
            seckeyID == info.seckeyID &&
            strcmp(clientID, info.clientID) == 0 &&
            strcmp(serverID, info.serverID) == 0 &&
            strcmp(seckey, info.seckey) == 0)
    {
        return true;
    }
    return false;
}
